<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>   

<c:set var="contextPath" value="${pageContext.request.contextPath}" />

<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.1//EN" "http://www.wapforum.org/DTD/xhtml-mobile11.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, width=device-width, target-densitydpi=medium-dpi" />
	<title>인권과 평화의 대학 - 성공회대학교</title>
	<link rel="stylesheet" href="${contextPath}/css/common/layout.css" type="text/css" />
	<script type="text/javascript" src="${contextPath}/js/common/lib/jquery-1.6.4.js"></script>
	<script type="text/javascript" src="${contextPath}/js/common/menu.js"></script>
	<link rel="stylesheet" href="${contextPath}/css/neuti/pr/skhu_news_list.css" type="text/css" />
	<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-32515688-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>
</head>
<body>
	
	<!-- 상단영역 -->
	<jsp:include page="../../common/header.jsp" />
	
	
	<!-- 가운데영역 -->
	<div id="center">
		
		<!-- 공통 네비게이션 -->
		<h2>
			<span class="nav_step_1">느티아래</span>
			<span class="nav_step_2">홍보마당</span>
			<span class="nav_step_3">SKHU_NEWS</span>
		</h2>
		<!-- 공통 부분 -->
		
		<div id="list">
			
			<c:choose>
				<c:when test="${listSize > 0}">
					<c:forEach items="${valueList}" var="valueList">
						<dl class="skhu_news">
							<dt class="clearAfter">
								<a href="${contextPath}/pr/skhu_news_view.do?${valueList.idx}">
									<c:choose>
										<c:when test="${fn:contains(valueList.img, 'http://www.skhu.ac.kr')}">
											<img src="${valueList.img}" alt="${valueList.title}" />								
										</c:when>   
										<c:otherwise>
											<img src="http://www.skhu.ac.kr${valueList.img}" alt="${valueList.title}" />
										</c:otherwise>
									</c:choose>
								
								</a>
								<a class="content_title" href="${contextPath}/pr/skhu_news_view.do?${valueList.idx}">${valueList.title}</a>
							</dt>
							<dd>
								<a href="${contextPath}/pr/skhu_news_view.do?${valueList.idx}">
									${valueList.content}
								</a> 
							</dd>
						</dl>
					</c:forEach> 
				</c:when>
				<c:otherwise>
					<dl class="skhu_news">
						<dd>
							<a href="${contextPath}/pr/skhu_news_list.do">
								검색 결과가 없습니다.
							</a> 
						</dd>
					</dl>
				</c:otherwise>
			</c:choose>
			
		</div>
		
		<div id="pagging">
			<a class="first" href="${contextPath}/pr/skhu_news_list.do?curPage=${paggingUtil.first}&amp;searchType=${searchType}&amp;searchWord=${searchWord}">
				<img src="${contextPath}/img/common/board/first.gif" alt="첫 페이지" />
			</a>
			<a class="prev" href="${contextPath}/pr/skhu_news_list.do?curPage=${paggingUtil.prev}&amp;searchType=${searchType}&amp;searchWord=${searchWord}">
				<img src="${contextPath}/img/common/board/prev.gif" alt="이전 페이지" />
			</a>
			
			<c:forEach begin="${paggingUtil.beginPage}" end="${paggingUtil.endPage}" var="num">
				<c:choose>
					<c:when test="${paggingUtil.curPage == num}">
						<a class="curPage" href="${contextPath}/pr/skhu_news_list.do?curPage=${num}&amp;searchType=${searchType}&amp;searchWord=${searchWord}">${num}</a>				
					</c:when>
					<c:otherwise>
						<a class="page" href="${contextPath}/pr/skhu_news_list.do?curPage=${num}&amp;searchType=${searchType}&amp;searchWord=${searchWord}">${num}</a>
					</c:otherwise>
				</c:choose>
			</c:forEach> 
			
			<a class="next" href="${contextPath}/pr/skhu_news_list.do?curPage=${paggingUtil.next}&amp;searchType=${searchType}&amp;searchWord=${searchWord}">
				<img src="${contextPath}/img/common/board/next.gif" alt="다음 페이지" />
			</a>
			<a class="last" href="${contextPath}/pr/skhu_news_list.do?curPage=${paggingUtil.last}&amp;searchType=${searchType}&amp;searchWord=${searchWord}">
				<img src="${contextPath}/img/common/board/last.gif" alt="마지막 페이지" />
			</a>
			
		</div> 
		
		<div id="search">
			<form action="${contextPath}/pr/skhu_news_list.do" method="post">
				<select id="searchType" name="searchType">
					<c:choose>
						<c:when test="${searchType == '1'}">
							<option value="1" selected="selected">제목</option>
							<option value="2">내용</option>
						</c:when>
						<c:otherwise>
							<option value="1">제목</option>
							<option value="2" selected="selected">내용</option>
						</c:otherwise>
					</c:choose>
				</select>
				
				<input type="text" id="searchWord" name="searchWord" value="${searchWord}" />
				<input type="submit" id="submit" value="확인" />
			</form>
		</div>
		
	</div>
	
	<!-- 하단영역 -->
	<jsp:include page="../../common/footer.jsp" />
	
</body>
</html>